enum Enum_MessageType {
  UnKnown(type: null, title: "未知类型"),
  Text(type: "Text", title: "文本类型"),
  Voice(type: "Voice", title: "语音消息", ossDir: "chat_voice"),
  Image(type: "Image", title: "图片消息", ossDir: "chat_image"),
  Video(type: "Video", title: "视频消息", ossDir: "chat_video"),
  ;

  final String? type, title, ossDir;

  const Enum_MessageType({required this.type, this.title, this.ossDir});

  static Enum_MessageType from(String? rawValue) => values.firstWhere((x) => x.type == rawValue, orElse: () => Enum_MessageType.UnKnown);
}
